using System.Windows.Forms;
using pub.CmdUI.Cmd;
using pub.CmdUI.UI.Control;

namespace todo.Cmd.Edit.TodoAttr
{
    public class ItalicCmd : DefaultCmd, ICmdState
    {
        public ItalicCmd()
        {
            Shortcut = new CmdShortcut(Keys.Control | Keys.I);
        }

        bool? ICmdState.Checked
        {
            get
            {
                //
                return TodoApi.Instance.IsItalic();
            }
        }

        bool ICmdState.Enabled
        {
            get { return TodoApi.Instance.ActiveTodo != null; }
        }

        public override void Execute(IControlUI controlUi)
        {
            TodoApi.Instance.ToggleItalic();
        }
    }
}